import {
  DashboardIcon,
  GitPullRequestIcon,
  RouterWaveIcon,
  Sensors1Icon,
  ThunderstormNightIcon,
} from "tdesign-icons-react";

// 产品编码定义
export enum ProductCode {
  // 16路烟感
  YG16 = 111,
  // 温湿度
  WSD = 112,
  // 加脂机
  JZJ = 109,
  // 水浸
  SJ = 114,
  // 综合温度
  WD = 116,
  // 轴承
  ZC = 108,
}

// 产品对应的采集数据值类型
export type RecordType = {
  // 名称
  name: string;
  // 数据字段
  field: string;
  // 数据类型
  type: string;
  // 数据单位
  unit: string;
};

export type RecordTypes = RecordType[];
// 产品对应的采集数据值类型
// 温度传感器：温度、湿度、电压
export type DataTypes = {
  [ProductCode.JZJ]: RecordTypes;
  [ProductCode.WSD]: RecordTypes;
  [ProductCode.WD]: RecordTypes;
  [ProductCode.YG16]: RecordTypes;
  [ProductCode.SJ]: RecordTypes;
  [ProductCode.ZC]: RecordTypes;
};

// 数据定义
export const DeviceRecordTypes = {
  [ProductCode.JZJ]: [
    {
      name: "温度",
      field: "value1",
      unit: "°C",
      icon: <ThunderstormNightIcon size={20} />,
    },
    {
      name: "电压",
      field: "value5",
      unit: "V",
      icon: <DashboardIcon size={20} />,
    },
    {
      name: "电流",
      field: "value2",
      unit: "mA",
      icon: <GitPullRequestIcon size={20} />,
    },
    {
      name: "剩余次数",
      field: "value3",
      unit: "次",
      icon: <ThunderstormNightIcon size={20} />,
    },
  ],
  [ProductCode.WSD]: [
    {
      name: "温度",
      field: "value1",
      unit: "°C",
      icon: <Sensors1Icon size={20} />,
    },
    {
      name: "湿度",
      field: "value2",
      unit: "%",
      icon: <ThunderstormNightIcon size={20} />,
    },
    {
      name: "电压",
      field: "value3",
      unit: "V",
      icon: <DashboardIcon size={20} />,
    },
  ],
  [ProductCode.WD]: [
    {
      name: "温度",
      field: "value1",
      unit: "°C",
      icon: <ThunderstormNightIcon size={20} />,
    },
    {
      name: "电压",
      field: "value2",
      unit: "V",
      icon: <DashboardIcon size={20} />,
    },
  ],
  [ProductCode.ZC]: [
    {
      name: "温度",
      field: "value1",
      unit: "°C",
      icon: <ThunderstormNightIcon size={20} />,
    },
  ],
  [ProductCode.YG16]: [
    {
      name: "烟感状态",
      field: "value1",
      unit: "",
      icon: <ThunderstormNightIcon size={20} />,
    },
  ],
  [ProductCode.SJ]: [
    {
      name: "水浸状态",
      field: "value1",
      unit: "",
      icon: <RouterWaveIcon size={20} />,
    },
    {
      name: "电池电压",
      field: "value2",
      unit: "V",
      icon: <ThunderstormNightIcon size={20} />,
    },
  ],
};
